#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 18-4-10 下午6:44
# @Author  : huanggz
# @File    : func.py
# @Software: PyCharm
# code is far away from bugs with the god animal protecting
import base64
from pang5_web.settings import DEBUG
def get_uid(cookie_str :str):

    if not DEBUG:
    # cookie = 'MTA2MjU2Nw==='
        cookie = cookie_str.replace('%3D', '=')
        if not cookie:
            return False
    # uid = get_uid(cookie)
        uid = int(int(base64.b64decode(cookie)) / 99 - 647)

        if uid:
            return uid
        else:
            return False
    else:
        return     466658